/*
 * Copyright (c) Zhongkehonglue Technologies Co., Ltd. 2025. All rights reserved.
 * Description: Implementation of functions related to periodic task.
 * Author: wangchunyang
 * Create: 2025-05-23
 */

#ifndef DMC_PERIODIC_TASK_H
#define DMC_PERIODIC_TASK_H

#include <thread>
#include <condition_variable>
#include "dmcApiTypes.h"

namespace DlnaDmc {
class PeriodicTask {
public:
    void start();
    void stop();
    ~PeriodicTask();
private:
    std::thread workerThread;
    std::condition_variable cv;
    std::mutex mtx;
    bool shouldStop = false;
    dmc_uint32 threadLoopCnt{0};
};
}
#endif /* DMC_PERIODIC_TASK_H */

